package com.bookstore.service;

import java.util.List;

import com.bookstore.dao.DAOFactory;
import com.bookstore.dao.ProductDAO;
import com.bookstore.model.Product;

public class ProductServiceImpl implements ProductService {

	@Override
	public Product findById(int id) throws Exception {
		ProductDAO productDAO = DAOFactory.getProductDAO();
		return productDAO.findById(id);
	}

	@Override
	public List<Product> findByHod(int num) throws Exception {
		ProductDAO productDAO = DAOFactory.getProductDAO();
		return productDAO.findByHot(num);
	}

	@Override
	public List<Product> findByNew(int num) throws Exception {
		ProductDAO productDAO = DAOFactory.getProductDAO();
		return productDAO.findByNew(num);
	}

}
